#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <stdlib.h>

int main()
{
	int n1 = 0;
	int n2 = 0;
	int arr1[21] = { 0 };
	int arr2[21] = { 0 };
	int count[41] = { 0 };
	int n = 0;

	scanf("%d", &n1);
	for (int i = 0; i < n1; i++)
	{
		scanf("%d", &arr1[i]);
	}

	scanf("%d", &n2);
	for (int i = 0; i < n2; i++)
	{
		scanf("%d", &arr2[i]);
	}
	for (int i = 0; i < n1; i++)
	{
		int flag = 0;
		for (int j = 0; j < n2; j++)
		{
			if (arr1[i] == arr2[j])
			{
				flag = 1;
			}
		}
		if (flag == 0)
		{
			count[n] = arr1[i];
			n++;
		}
	}

	for (int j = 0; j < n2; j++)
	{
		int flag = 0;
		for (int i = 0; i < n1; i++)
		{
			if (arr1[i] == arr2[j])
			{
				flag = 1;
			}
		}
		if (flag == 0)
		{
			count[n] = arr2[j];
			n++;
		}

	}

	for (int i = 0; i < n; i++)
	{
		for (int j = i+1; j < n; j++)
		{
			if (count[i] == count[j])
			{
				for (int a = j; a < n; a++)
				{
					count[a] = count[a + 1];
				}
				n--;

			}
		}
	}

	for (int i = 0; i < n; i++)
	{
		if (i == n - 1)
		{
			printf("%d", count[i]);
		}
		else
		{
			printf("%d ", count[i]);
		}

	}


	return 0;
}